package com.example.eassyjoke;

import androidx.appcompat.app.AppCompatActivity;

import android.app.Service;
import android.content.Context;
import android.content.Intent;
import android.os.Build;
import android.os.Bundle;
import android.util.Log;
import android.view.View;
import android.widget.TextView;
import android.widget.Toast;

import com.hc.baselibray.GuardService;
import com.hc.baselibray.JobWakeUpService;
import com.hc.baselibray.MessageService;
import com.hc.baselibray.MyService;
import com.hc.baselibray.dialog.AlertDialog;
import com.hc.baselibray.ioc.CheckNet;
import com.hc.baselibray.ioc.OnClick;
import com.hc.baselibray.ioc.ViewById;
import com.hc.baselibray.ioc.ViewUtils;
import com.hc.baselibray.navigationBar.DefaultNavigationBar;

public class MainActivity extends AppCompatActivity {
   private TextView mTestTv;
   private  static String TAG="activity";
    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        mTestTv=findViewById(R.id.tv);
        mTestTv.setText("你好啊");
        Context context=this;
        DefaultNavigationBar defaultNavigationBar=new DefaultNavigationBar.Builder(this)
                .setTitle("标题")
                .setRightTitle("右边")
                .setRightOnclickLister(new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        Toast.makeText(context,"点击右侧文字",Toast.LENGTH_LONG).show();
                    }
                })
                .builder();
        mTestTv.setOnClickListener(new View.OnClickListener() {
            @Override
            public void onClick(View view) {

        //        startService(new Intent(MainActivity.this, MessageService.class));
               startService(new Intent(MainActivity.this, MyService.class));
             startService(new Intent(MainActivity.this, GuardService.class));
//                //必须大于5。0
             startService(new Intent(MainActivity.this, JobWakeUpService.class));
                Toast.makeText(context,"点击右侧文字",Toast.LENGTH_LONG).show();
            }
        });



    }

    public  void  test(View view) throws IllegalAccessException {
//        Log.d(TAG, "test:点击了");
       // Toast.makeText(this,"click",Toast.LENGTH_LONG).show();
        Context context=this;
        AlertDialog dialog=new AlertDialog.Builder(this)
                .setContentView(com.example.baselibrary.R.layout.detail_comment_dialog)
                .setOnClickListener(com.example.baselibrary.R.id.btn1, new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        Toast.makeText(context,"点击了按钮1",Toast.LENGTH_LONG).show();
                    }
                })
                .setOnClickListener(com.example.baselibrary.R.id.btn2, new View.OnClickListener() {
                    @Override
                    public void onClick(View view) {
                        Toast.makeText(context,"点击了按钮2",Toast.LENGTH_LONG).show();
                    }
                })
                .formBottom(true)
                .fullWidth()
                .show();
    }
}